<?php
require('includes/top.php');
$fname = $_POST["fname"];		
$lname = $_POST["lname"];
$address = $_POST["address"];
$email = ($_POST["email"]);	
$company_name = ($_POST["company_name"]);
$phoneNo = $_POST["code"].'-'.$_POST["phoneNo"];
$mobNo = $_POST["mobNo"];		
$username=$_POST['username'];
$pwd=$_POST['pwd'];
//echo $strDesc;
//$strDate = date('M j, Y');
//$struid = $_SESSION['uid'];

//$target_path = "news_images/";

//$filename = 'news_images/'.$_FILES['uploadedfile']['name'];


/*	if (file_exists($filename)) 
		{
		echo "The file $filename exists";
	    } 
	else 
		{
	$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
		if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
			{
			
			} 
		else
			{
		echo "There was an error uploading the file, please try again!";
	        }
		}*/
	 
	  
	  $sql="INSERT INTO users(`fname`,`lname`,`address`,`phone`,`mob`,`username`,`password`,`email`,`company_name`) VALUES ('$fname', '$lname', '$address', '$phoneNo', '$mobNo','$username','$pwd','$email','$company_name')";
		//echo $sql;
$result=mysql_query($sql);
 if($result)
 {
header("location:add_user.php");
 }
 else
 {
	 echo mysql_error();
 }

ob_flush();
?>
 